﻿
function cspMediaBlock_parseMetaTag(linkId){wtRemoveCId(linkId);return true;}
function cspMediaBlock_setImageStyle(divClass,divId,imgStyle){var browserUA=navigator.userAgent.toLowerCase();var object_div=document.getElementById(divId);if(object_div!=null&&object_div.getElementsByTagName("object").length>0){var img_div=cspGetObjectsOfElementByTagAndClass(object_div.parentNode,"div",divClass);if(img_div.length>0){for(var i=0;i<img_div.length;i++){if((browserUA.indexOf("firefox")!=-1||browserUA.indexOf("msie")!=-1||browserUA.indexOf("safari")!=-1||browserUA.indexOf("opera")!=-1)&&object_div.getElementsByTagName("object")[i].type!="application/x-shockwave-flash"){img_div[i].style.display=imgStyle;}}}}
return true;}
function cspMediaBlock_isFlashInstalled(){return cspMediaBlock_getFlashVersion()>=6;}
function cspMediaBlock_getFlashVersion(){var i;if(window.ActiveXObject){for(i=12;i>5;i--){try{var flash=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);return i;}catch(e){}}}else if(navigator.plugins&&navigator.plugins.length){for(i=0;i<navigator.plugins.length;i++){if(navigator.plugins[i].name.indexOf("Shockwave Flash")!=-1){return navigator.plugins[i].description.split(" ")[2];}}}
return 0;}
function cspMediaBlock_writeFlashObject(swfFile,width,height,divId){if(width==0||width==undefined){width="";}
if(height==0||height==undefined){height="";}
document.getElementById(divId).innerHTML="<object "+(width!=""?" width=\""+width+"\"":"")+(height!=""?" height=\""+height+"\"":"")+" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"><param name=\"movie\" value=\""+swfFile+"\"><param name=\"allowScriptAccess\" value=\"always\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed "+(width!=""?" width=\""+width+"\"":"")+(height!=""?" height=\""+height+"\"":"")+" src=\""+swfFile+"\" quality=\"high\" bgcolor=\"#ffffff\" align=\"middle\" allowScriptAccess=\"always\" type=\"application\/x-shockwave-flash\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" wmode=\"transparent\"></object>";return true;}
function cspMediaBlock_showFlash(swfFile,width,height,divId,flImgCid,flCid,flImgId){if(cspMediaBlock_isFlashInstalled()){cspMediaBlock_writeFlashObject(swfFile,width,height,divId);if(flCid!=flImgCid){cspMediaBlock_parseMetaTag(flImgCid);}}else{cspMediaBlock_setImageStyle(flImgId,divId,"block");if(flCid!=flImgCid){cspMediaBlock_parseMetaTag(flCid);}}}
function cspMediaBlock_shouldShowSilverlight(version){return Silverlight.supportedUserAgent()&&Silverlight.isInstalled(version);}
function cspMediaBlock_showSilverlight(slVer,slId,xamlFile,slWidth,slHeight,slColor,isWinLess,slFramerate,slImgCid,slImgId,slCid){if(cspMediaBlock_shouldShowSilverlight(slVer)){var silverlightDiv=document.getElementById(slId);cspMediaBlock_CreateSilverlightObject(xamlFile,silverlightDiv,slId,slWidth,slHeight,slColor,isWinLess,slFramerate,slVer);if(slCid!=slImgCid){cspMediaBlock_parseMetaTag(slImgCid);}}else{cspMediaBlock_setImageStyle(slImgId,slId,"block");if(typeof $$SL!="undefined"){$$SL.registerCreative(jQuery.proxy(function(){var silverlightDiv=document.getElementById(slId);cspMediaBlock_CreateSilverlightObject(xamlFile,silverlightDiv,slId,slWidth,slHeight,slColor,isWinLess,slFramerate,slVer);var dcsuri=window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")+1)+($$SG.get_IsDirectInstall()==true?"directinstall/panel":"pagegate/panel");dcsMultiTrack("DCS.dcsuri",dcsuri,"DCSext.wt_linkid",slCid,"WT.dl","5","WT.ti","Silverlight Panel Refresh","WT.ad","","WT.mc_id","","WT.seg_4","Yes","WT.sli","Yes","WT.slv","1.0");cspMediaBlock_setImageStyle(slImgId,slId,"none");},window));}
if(slCid!=slImgCid){cspMediaBlock_parseMetaTag(slCid);}}}
function cspMediaBlock_CreateSilverlightObject(xamlFile,silverlightDiv,slId,slWidth,slHeight,slColor,isWinLess,slFramerate,slVer){Silverlight.createObject(xamlFile,silverlightDiv,slId+"_object",{width:slWidth,height:slHeight,background:slColor,isWindowless:isWinLess,framerate:slFramerate,version:slVer,enableFramerateCounter:"false",ignoreBrowserVer:"false",inplaceInstallPrompt:"false"},{onError:function(){},onLoad:null,onResize:null},null);}

if(typeof window.Dsp=="undefined")window.Dsp={};Dsp.TopDownloads=function(a){this.headCId=a.headC;this.dataCId=a.dataC;this.updateProgressId=a.updateProgressId;this.categoryDropDownId=a.categoryDropDown;this.goButtonId=a.goButtonId};Dsp.TopDownloads.prototype={delegate:function(a,b){return function(){return b.apply(a,arguments)}},widthAdjust:function(){var c=$(".btnGo"),a=$(".selectCatg");a.removeClass("selectMaxWidth");a.attr("offsetWidth")>382?a.addClass("selectMaxWidth"):a.removeClass("selectMaxWidth");var b=c.attr("offsetWidth")+a.attr("offsetWidth")>350;if(b)$(".dsp-tpdl").addClass("wide");else $(".dsp-tpdl").removeClass("wide")},init:function(){$("#"+this.headCId).removeClass("nodisplay");$("#"+this.dataCId).removeClass("nodisplay").addClass("datac");$get(this.categoryDropDownId).selectedIndex=0;this.widthAdjust();if(Sys.Browser.agent==Sys.Browser.InternetExplorer)$(".headc_right").bind("resize",this.widthAdjust);else{$(".headc_right").css("max-width","390px");$(".selectCatg").css("max-width","300px")}var b=Sys.WebForms.PageRequestManager.getInstance();b.add_endRequest(this.delegate(this,this.endRequest));var a;if(Sys.Browser.agent==Sys.Browser.InternetExplorer)a="click";else a="mousedown";$("#"+this.goButtonId).bind("click",Function.createDelegate(this,this.calCss)).bind(a,Function.createDelegate(this,this.goButtonClick));if(window.silvergate&&window.$$SG&&$$SG.get_IsDisplayed())silvergate.registerUnload(this.delegate(this,function(){this.webTrends(this.delegate($$dbi,$$dbi.wtmt2))}));else $().ready(this.delegate(this,function(){this.webTrends(this.delegate($$dbi,$$dbi.wtmt2))}))},abortAnimation:function(){var a=Sys.WebForms.PageRequestManager.getInstance();if(a.get_isInAsyncPostBack())a.abortPostBack()},calCss:function(){var a=$(".top-outer"),b=$(".top-inner");a.parent().show();a.css("height",$(".dsp-tpdl").height()+"px");a.css("width",$(".dsp-tpdl").width()+"px");b.css("padding-top",(a.height()-b.height())/2+"px")},goButtonClick:function(){var a=$get(this.categoryDropDownId);if(a){var b=a.options[a.selectedIndex].value,c=a.options[a.selectedIndex].text;if(b=="")b="0";$$dbi.swtp({"cid":"18","stype":"ss_nd;ss_pd","catid":b,"sterm":c,"prodid":"-1"})}},endRequest:function(d,a){var b=a.get_error();if(b!=null){a.set_errorHandled(true);var c=Sys.WebForms.PageRequestManager.getInstance();c.abortPostBack()}},webTrends:function(d){var a=$get(this.categoryDropDownId);if(a){var b=a.options[a.selectedIndex].value,c=a.options[a.selectedIndex].text;if(b=="")b="0";d({"cid":"18","stype":"ss_nd;ss_pd","catid":b,"sterm":c,"prodid":"-1"},"2")}}}

if(typeof window.Dsp=="undefined")window.Dsp={};Dsp.PopularTrials=function(a){this.previousId=a.previousId;this.nextId=a.nextId;this.contentAreaId=a.contentAreaId;this.index=1;this.maxIndex=1;this.pageSize=4;this.linkImpression=[];this.linkImpression[0]=1};Dsp.PopularTrials.prototype={el:null,init:function(){el=this;if(this.maxIndex>1){var a=$("#"+this.previousId);a.css("visibility","").click(function(){el.onPreviousClick.apply(el)});var b=$("#"+this.nextId);b.css("visibility","").click(function(){el.onNextClick.apply(el)});this.onIndexChanged();this.areaObj=$("#"+this.contentAreaId);if(this.areaObj.css("marginTop")=="")this.areaObj.css("marginTop","0px");this.ffAdjustment=this.areaObj.attr("offsetTop");this.setTabIndex()}},showSlidePage:function(){if(this.areChildElementsCreated!="undefined"&&this.areChildElementsCreated==false){this.createChildElements(this.moreTrialElements);this.areChildElementsCreated=true}var a=this.getUnOrderedListObj(this.areaObj);if(a!=null){this.areaObj.css("marginTop",-1*this.itemHeight*(this.index-1)+"px");this.setTabIndex()}},setTabIndex:function(){this.areaObj.find("li a").each(function(){var a=$(this).find("img").size()>0?-1:0,b=$(this).parents("li")[0];if($.browser.mozilla){if(b.offsetTop-el.ffAdjustment!=0)a=-1}else if(a==0)if(el.ffAdjustment!=0){if(Math.abs(b.offsetTop)>90)a=-1}else if(-b.offsetTop+"px"!=el.areaObj.css("marginTop"))a=-1;this.tabIndex=a})},onPreviousClick:function(){this.index--;this.onIndexChanged();this.showSlidePage(this.index);this.sendLinkImpression()},onNextClick:function(){this.index++;this.onIndexChanged();this.showSlidePage(this.index);this.sendLinkImpression()},sendLinkImpression:function(){if(typeof this.linkIDArray!="undefined"&&this.linkIDArray.length>0)if(this.linkImpression[this.index-1]==0){var b=(this.index-1)*this.pageSize,d=b+this.pageSize-1,c=[];for(var a=b;a<=d;a++)c.push(this.linkIDArray[a]);this.linkImpression[this.index-1]=1;$$dbi.wtmt2({"linkid":c.join(";")},"0")}},setMoreTrials:function(a){if(a.length>0){this.maxIndex+=Math.ceil(a.length/this.pageSize);this.moreTrialElements=a;this.areChildElementsCreated=false;for(var b=1;b<this.maxIndex;b++)this.linkImpression[b]=0;this.linkIDArray=[];this.linkIDArray.push(-1,-1,-1,-1);for(b in a){this.linkIDArray.push(a[b].l);if(typeof g_LinkIdNotInPageImp!="undefined")g_LinkIdNotInPageImp.push(a[b].l)}}},getUnOrderedListObj:function(a){return a.find("ul:first")},createChildElements:function(b){if(this.areaObj){var d=this.getUnOrderedListObj(this.areaObj);if(d){var e=$.browser.msie?"click":"mousedown",f=function(b,a){return function(){$$dbi.swtp({"cpgn":a,"linkid":b})}};for(var a=0;a<b.length;a++){var g=(a+1)%4==0?"nows":"ws";$(d).append($("<li/>").addClass("fl").addClass(g).append($("<a tabindex='-1' />").attr("title",b[a].t).attr("href",b[a].u).bind(e,f(b[a].l,b[a].c)).append($("<img width='81' height='95' />").attr("alt",b[a].t).attr("src",b[a].m))).append($("<a tabindex='-1' />").attr("href",b[a].u).bind(e,f(b[a].l,b[a].c)).text(b[a].t)))}var c=this.areaObj.find("li");this.items=c.length;this.itemHeight=0;for(var a=0;a<c.length;a++)if(this.itemHeight<Sys.UI.DomElement.getBounds(c[a]).height)this.itemHeight=Sys.UI.DomElement.getBounds(c[a]).height;c.css("height",this.itemHeight+"px");this.areaObj.parent().css("height",this.itemHeight+"px")}}},onIndexChanged:function(){var a=this.index,b=$("#"+this.previousId),c=$("#"+this.nextId);if(a<=1)b.css("visibility","hidden");else if(a>=this.maxIndex)c.css("visibility","hidden");if(a>1)b.css("visibility","");if(a<this.maxIndex)c.css("visibility","")}}
